package cacy.leetcode.string;


/**
 * @author 凯齐
 * @date 2025-02-26 14:47
 * @description
 * 假定一段路径记作字符串 path，其中以 "." 作为分隔符。
 * 现需将路径加密，加密方法为将 path 中的分隔符替换为空格 " "，请返回加密后的字符串。
 *
 * 示例 1：
 * 输入：path = "a.aef.qerf.bb"
 * 输出："a aef qerf bb"
 *
 * 限制：
 * 0 <= path.length <= 10000
 *
 */

class SolutionString01 {
    public String pathEncryption(String path) {
        char[] array = path.toCharArray();
        for (int i = 0; i < array.length; i++) {
            // Change to '/' rather than '.'
            if (array[i] == '/') {
                array[i] = ' ';
            }
        }
        String res = String.valueOf(array);
        return res;
    }
}

public class String01 {
    public static void main(String[] args) {
        String testString = "http://http://localhost:8080/StudentInformationSystem_SpringVersion/student/studentManagementView.html";
        String res = new SolutionString01().pathEncryption(testString);
        System.out.println(res);
    }
}
